package keeto.com.vn.bms.ui.adapter;

import java.util.ArrayList;

import keeto.com.vn.bms.model.InfoReportModel;
import keeto.com.vn.bms.ui.activity.R;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class InfoReportAdapter extends BaseAdapter {
	private Context ctx;
	private ArrayList<InfoReportModel> mArrayList;
	private LayoutInflater mInflater;
	
	public InfoReportAdapter(Context context, ArrayList<InfoReportModel> Lists) {
		super();
		this.ctx = context;
		this.mArrayList = Lists;
		this.mInflater = LayoutInflater.from(context);
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return mArrayList.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return mArrayList.get(position);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		ViewHolder holder;
		if (convertView == null){
			convertView = mInflater.inflate(R.layout.item_info_report_layout,null);
			holder = new ViewHolder();
			holder.tvRepportContent = (TextView)convertView.findViewById(R.id.tv_info_report_content);
			convertView.setTag(holder);
		}else{
			holder = (ViewHolder) convertView.getTag();
		}
		
		holder.tvRepportContent.setText(mArrayList.get(position).getReportName());
		
		return convertView;
	}


	class ViewHolder{
		private TextView tvRepportContent;
	}

}
